import  tpl_helpers  # calls   parent_dir_2path() -- to let imports
from generate_via_decorators import generate_calls, set_cat_sub_path, call_functions_by_decorators
    
@generate_calls( 
    #_pinigai = [-10,              0,           1, 5, 9] ,
    #groups =   ["less", 1,     "equal", 1,   "more", 3]    ,
    _pinigai = [-10, -7, -2,    0,             0.5, 9] ,
    groups =   ["less", 3,     "equal", 1,   "more", 2]    ,
)
def ifMoreLess0_noEqual( _pinigai ): 
    pinigai = _pinigai  
    if pinigai > 0:
       print( "Turim", pinigai )
    if pinigai < 0:
       print( "Skoloj", -pinigai)
    print("Eur")


@generate_calls(
    _pinigai   = [17, 15,     10,  10, 15,      15, 10, 12, ], ## randint(10, 20)
    _kebabas   = [10,  3,      6,   8,  2,       8,  6,  8, ], ## randint(2, 10)
    _sokoladas = [ 1,  2,      4,   1,  3,       1,  4,  5, ],  ## randint(1, 5)   
    _valanda   = [10,  8,     12,  14, 15,      17, 22, 16, ],
    groups  =  ["nieko", 2,    "dali", 3,        "visus", 3  ],
)
def pinigu_leidimas(_pinigai, _kebabas, _sokoladas, _valanda):
    pinigai = _pinigai    
    kebabas = _kebabas      
    sokoladas = _sokoladas   
    valanda = _valanda

    print( "buvo", pinigai )

    if valanda >= 12:    # laikas pietums
       pinigai = pinigai - kebabas
       
    if valanda > 15:     # laikas pavakariams
       pinigai = pinigai - sokoladas 

    print( "liko", pinigai )


#####################################################################################
if __name__=="__main__":
    set_cat_sub_path( "NG: Variables and Conditions" )
    

    def name_by_file(tag='.GIFT.txt'):
        import inspect
        return inspect.getfile(inspect.currentframe()) [:-len('.py')] + tag
        
    call_functions_by_decorators(fun_dict=globals(), outfile='out_generated/'+name_by_file() )
    
        

"""        

***
def ifMore():
    taskai = 15
    
    if taskai > 10:       # if   >  :
        pergale = True
    
    print(pergale)
***

if vidurkis < 4:
   print("prastai")
else:
   print("normaliai")

***

vardas = input("Kas tu?")

amzius = int( input("Kiek tau metų?") )

print( vardas, "gimė prieš", amzius, "metų.")

***

preke = "duona"
kaina = 2.5

print( preke, "kainuoja", kaina, "Lt" )

***
"""
